<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 14-5-30
 * Time: 下午11:43
 */
class Mapplyinterview extends CI_Model{
    function __construct(){
        parent::__construct();
    }

    /**
     * 获取微访谈报名
     * @param $uid
     * @param $phone
     * @param $weixin
     * @return mixed
     */
    function getApply($realname,$pageSize,$order='id ASC')
    {
        $where = '1=1';
        !empty($realname) && $where .= ' and realname="'.$realname.'"';
        $sqlCount = $this->db->query("select * from `apply_interview` where $where");
        $count = $sqlCount->num_rows();

        $sql = "select * from `apply_interview` where $where order by $order limit ";

        $query = $this->db->pager($count,$pageSize,$sql);

        return $query;
    }

    /**
     * 删除微访谈报名
     * @param $id
     */
    function deleteApply($id)
    {
        $ids = explode(',',$id);
        $this->db->where_in('id', $ids);
        $this->db->delete('apply_interview');
    }
}